#include<iostream>
using namespace std;

int a[15][15];

int main()
{
	int n;
	cin>>n;
	int k = 1;
	for(int i = 1;i <= n;i++)
	{
		for(int x = 1, y = i;x <= i && y >= 1;x++, y--)
		{
			if(i&1)
				a[y][x] = k++;
			else
				a[x][y] = k++;
		}
	}
	
	for(int l = 1;l <= n-1;l++)
	{
		for(int i = l+1, j = n;i <= n && j >= l+1;i++, j--)
		{
			if((n+l)&1)
				a[j][i] = k++;
			else
				a[i][j] = k++;
		}
	}
	
	for(int i = 1;i <= n;i++)
	{
		for(int j = 1;j <= n;j++)
			cout<<a[i][j]<<" ";
		cout<<endl;
	}
	return 0;
}
